package com.ts.api.module.match.plan.internal.distribute.model;

import com.ts.api.module.match.plan.model.AbstractPlanMatch;
import lombok.Data;

/**
 *  分发后实体类
 *
 *  @author Pan
 */
@Data
public class PlanDistributePost {

    /** 本次请求id */
    private String reqId;
    /** 渠道匹配实体 */
    private AbstractPlanMatch abstractPlanMatch;
    /** 分发对象 */
    private PlanDistribute planDistribute;
    /** 解析后的业务字段处理 */
    private PlanDistributeField planDistributeField;

    /**
     *  构建分发后检测对象
     *
     *  @param  planDistribute                  分发对象
     *  @param  planDistributeField             分发业务字段
     *  @return PlanDistributePost              分发后处理对象
     */
    public static PlanDistributePost of(PlanDistribute planDistribute, PlanDistributeField planDistributeField) {
        PlanDistributePost planDistributePost = new PlanDistributePost();
        planDistributePost.setPlanDistribute(planDistribute);
        planDistributePost.setPlanDistributeField(planDistributeField);
        planDistributePost.setAbstractPlanMatch(planDistribute.getAbstractPlanMatch());
        planDistributePost.setReqId(planDistribute.getReqId());
        return planDistributePost;
    }
}
